import { http } from "@/utils/http";
import { baseUrlApi } from "../utils";

/** 获取基础档案-品牌管理列表 */
export const getBrandPage = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/brand/page"), { params });
};

/** 基础档案--品牌管理列表-新增品牌管理 */
export const brandAdd = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/brand/add"), { data });
};

/** 基础档案-品牌管理列表-编辑品牌管理 */
export const brandUpdate = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/brand/update"), { data });
};

/** 基础档案-品牌管理列表-删除品牌管理 */
export const brandDelete = (id?: object) => {
  return http.request<any>("post", baseUrlApi(`/brand/delete?id=${id}`));
};

/** 上传图片 */
export const upload = (data?: object) => {
  return http.request<any>(
    "post",
    baseUrlApi("/common/upload"),
    { data },
    {
      headers: {
        "Content-Type": "multipart/form-data"
      }
    }
  );
};
